package com.jeff.serviceImpl;

import com.jeff.common.mConst;
import com.jeff.mapper.FormMapper;
import com.jeff.mybatis.page.Page;
import com.jeff.po.Form;
import com.jeff.service.FormService;
import com.jeff.vo.FormGroupPage;
import com.jeff.vo.FormShow;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class FormServiceImpl extends BaseServiceImpl<Form, String> implements FormService {
    @Autowired
    private FormMapper formMapper;

    @Autowired
    public void setBaseMapper() {
        super.setBaseMapper(formMapper);
    }

    @Override
    public Page<FormGroupPage> queryByPage(Form t) {
        return this.buildVoPage(formMapper.queryByPage(t));
    }

    @Override
    public int remove(String id) {
        Form form = new Form();
        form.setId(id);;
        form.setState(mConst.STATE_F);
        this.update(form);
        return 0;
    }

    @Override
    public FormShow showForm(String id) {
        return formMapper.showForm(id);
    }
}
